<?php
/**
 * Cart_AdminController
 * 
 * @author
 * @version 
 */

class Images_SettingsController extends Zen_Controller_Admin {
	public function indexAction() {
		/*-----Настройки------*/
		$form = new Images_Form_Settings ();
		$module = 'images';
		$namespace = 'settings';
		
		
		$defaults = Zen_Settings::get($module, $namespace );
		if ($defaults) {
			$form->setDefaults ( $defaults );
		}
		if ($this->_request->isPost ()) {
			if ($form->isValid ( $this->_getAllParams () )) {
				Zen_Settings::set ( $module, $namespace, $form->getValues () );
				$this->_helper->FlashMessenger->setNamespace ( 'messages' )->addMessage ( array ('text' => 'Изменения сохранены', 'type' => 'alert' ) );
				$this->_redirect ( $_SERVER ['REQUEST_URI'] );
			}
		}
		$this->view->form = $form;
	}
	
}